/**
 * www.lifexx.com Inc.
 * Copyright (c) 2014 All Rights Reserved.
 */
package net.mikoo.seals.agent.biz.services;

import java.util.List;

import net.mikoo.seals.agent.model.Menu;
import net.mikoo.seals.agent.model.RolePermit;

/**
 *                       
 * @Filename RolePermitService.java
 *
 * @Description 
 *
 * @Version 1.0
 *
 * @Author chenzx
 *
 * @Email chenzx1206@163.com
 *       
 * @History
 *<li>Author: chenzx</li>
 *<li>Date: 2015年1月27日</li>
 *<li>Version: 1.0</li>
 *<li>Content: create</li>
 *
 */
public interface RolePermitService {
	
	public List<Menu> loadHaveResource(Long partyId);
	
	/**
	 * 查询当事人拥有的资源
	 * @param partyId
	 * @return
	 */
	public List<Menu> loadRootResource(Long partyId);
	
	/**
	 * 查询当事人拥有的子菜单
	 * @param partyId
	 * @return
	 */
	public List<Menu> loadSubResource(Long partyId,Long parentId);
	
	public List<RolePermit> loadByPrimaryKey(Long roleId);
	
	public void deleteByPrimaryKey(Long roleId);
	
	public List<RolePermit> loadAsTree(Long roleId);
	
	public void updateByRoleIdAndMenuId(final Long roleId, final String[] menuIds);

	/**
	 * 查询角色下的所有资源
	 * @param roleId
	 * @return
	 */
	public List<Menu> loadResourceByRoleId(Long roleId);
}
